// -------------------------------------------------------------
// common: queryRecordsInfo
// time: 2020-07-24
// author: minner
// -------------------------------------------------------------
exports.queryRecordsInfo = function (table, pkey, ids, fields, callback) {
    let ids2 = [];
    ids.forEach(element => {
        if (!ids2.includes(element)) {
            ids2.push(element);
        }
    });
    if (!ids2.length) {
        return callback(false);
    }
    let sql_select = "SELECT " + pkey + "," + fields + " FROM " + table + " WHERE " + pkey + " IN(" + ids2 + ")";
    uim.db_query(sql_select, function (err, results, fields) {
        if (err) {
            console.log('-------------------------')
            console.log({ err })
            return callback(false);
        }
        console.log('-------------------------')
        console.log({ results })
        // let recordsInfo = {};
        // for (var tmp_i = 0; tmp_i < results.length; tmp_i++) {
        //     recordsInfo[results[tmp_i][pkey]]
        // }
        callback(uim.array_column_kv(results, pkey));
    });
};
